#!/usr/bin/env python

import unittest
import fimero.core.util.LogKit as LogKit
import fimero.core.text.TemplateKit as TK

LOGGER = LogKit.get_logger(__name__)

LOGGER.debug('from initialize')

class TestTemplateKit(unittest.TestCase):
    
    def test_lookup_template(self):
        
        template = TK.lookup_template('mytemp.mako')
        self.assertFalse(None == template)
        

    def test_populate_template(self):
        
        args = {}
        args['name'] = 'alice'
        args['colors'] = ['red', 'green', 'blue']
        
        buf = TK.render_template('mytemp.mako', args)
        value = buf.getvalue()
        self.assertTrue(len(value) > 10)
        LOGGER.debug(value)
        
if __name__ == "__main__":
    unittest.main() 